
// es5

var fn1 = function(){

    console.log('普通函数');
}

var fn2 = function(x,y){

    return x+y
}

function getMax(){
    let max = arguments[0]
    for(var i=0;i<arguments.length;i++){
        if(max<arguments[i]){
            max=arguments[i]
        }
    }

    return max
}


let max = getMax(1,2,3,4,5,6,7,11,99,100)
console.log(max);


// es6

let fn4 = ()=>{
    console.log('普通箭头函数');
}

fn4()


let fn5 = ()=>'你好'

let fn6 = ()=>{
    return '你好'
}

let fn7 = (x,y,z)=>x*y*z

let fn8 = (x,y,z)=>{
    return x*y*z
}

var ret = fn5()
console.log(ret);

console.log(fn7(1,2,3));

console.log('==================================');
for(let i = 0;i<5;i++){
    setTimeout(()=>{
        console.log(i);
    },1000)
}
// module.exports.a="10"
console.log(this)

